
using Microsoft.EntityFrameworkCore;
using StoreApp.Domain;
using StoreApp.Repository;

var builder = WebApplication.CreateBuilder(args);
var conString = builder.Configuration.GetConnectionString("mysql");
builder.Services.AddDbContext<StoreDbContext>(p =>
{
    p.UseMySql(conString, ServerVersion.AutoDetect(conString));
});
builder.Services.AddScoped(typeof(IRepository<>), typeof(EfRepository<>));

builder.Services.AddControllers();

var app = builder.Build();

app.MapControllers();
app.Run();
